package com.base.lock;

import com.base.lock.exception.LockFailureException;
import lombok.extern.slf4j.Slf4j;

/**
 * @author carl
 */
@Slf4j
public class DefaultLockFailureStrategy implements LockFailureStrategy {

    @Override
    public void onLockFailure(String key, long acquireTimeout, int acquireCount) {
        log.debug("thread:{} acquire lock fail,key:{} acquireTimeout:{}ms", Thread.currentThread().getName(), key,
                acquireTimeout);
        throw new LockFailureException("request failed,please retry it.");
    }
}
